<script>
var app = getApp();
var r = uni.getStorageSync('COOK_U');

export default {
  name: "broker",
  data() {
    return {
      brokerObj: {},
      flax: '0',
    }
  },
  onLoad() {
    this.init();
  },
  methods: {
    //推荐信息
    init() {
      const that = this;
      const data = {
        submitok: 'Referrer',
        openid: (r = uni.getStorageSync('COOK_U')).openid,
      };
      app.globalData.ajax({
        url: '/tg.php',
        data: data,
        success: function (a) {
          that.flax = a.flag
          if ('1' === a.flag) {
            that.brokerObj = a.D;
          } else {
            // uni.showToast({
            //   title: a.msg,
            //   icon: 'none',
            //   mask: true
            // });
          }
          uni.hideLoading();
        }
      });
    },
  }
}
</script>

<template>
  <view class="broker">
    <view v-if="flax === '1'" class="photo_s">
      <image :src="brokerObj.photo_s" class="m"
             mode="aspectFill"></image>
      <view class="em">
        <view class="h4">
          {{ brokerObj.nickname }}
          <text class="id ico">
            （ID:{{ brokerObj.id }}）
          </text>
        </view>
        <view class="gradeico">{{ brokerObj.mob }}
        </view>
      </view>
    </view>
    <view v-else class="empty">
      <image mode="aspectFit" src="/static/res/img/nodata.png"></image>
      <view>
        <view>~~ 情感导师是有风之恋 ~~</view>
      </view>
    </view>
    <!--    <view class="TG_U_box">-->
    <!--        <view class="dl">-->
    <!--          <view class="dt">-->
    <!--            <image mode="aspectFill" :src="brokerObj.photo_s"></image>-->
    <!--          </view>-->

    <!--          <view class="dd">-->
    <!--            <view class="h4">-->
    <!--              <text class="span">{{ brokerObj.nickname }}</text>-->
    <!--              <view class="time">{{ brokerObj.id }}</view>-->
    <!--            </view>-->
    <!--          </view>-->

    <!--          <view class="tgflag">-->
    <!--            <text :class="'span' + (item.tgflag == 1 ? ' ed' : '')">{{ brokerObj.tgflag_str }}</text>-->
    <!--          </view>-->

    <!--          <view class="price">-->
    <!--            <text :class="'span' + (item.tgmoney > 0 && item.tgflag == 1 ? ' ed' : '')">{{ brokerObj.tgmoney_str }}</text>-->
    <!--          </view>-->
    <!--        </view>-->
    <!--    </view>-->
  </view>
</template>

<style lang="scss" scoped>
@import "broker.scss";
</style>